	function clsClubAdminLetterView_Info(){
		this._HTMLDom = null;	
		this.listData = null;
		this.idx = null;
		this._init();
	}
	
	clsClubAdminLetterView_Info.prototype = {
		_init: function(){
			var $layer = $("section#club_admin_letter_view");
			
			this._HTMLDom = {
				"$layer": $layer
				, "$element": $layer.find(">section>div>ul")
			}
			
		}
		, setList: function(thisData){
			this.listData = thisData;
			this.display();
		}
		, display: function(){
			var $element = this._HTMLDom["$element"];
			var role = "";
			
			if(this.listData["발송대상"] == "0") role = "회원전체"
			else if(this.listData["발송대상"] == "A") role = "일반회원"
			else if(this.listData["발송대상"] == "M") role = "매니저"
			
			
			$element.find("li:eq(0)>div>p").html(role);
			$element.find("li:eq(1)>div>p").html(_util.fDateYmd(this.listData["발송일자"]) + "&nbsp;" + _util.fTime(this.listData["발송시간"], ":"));
			$element.find("li:eq(2)>div.input_letter_textarea").html(this.listData["메세지"]);
		}
		, $getLayer: function(){
			return this._HTMLDom["$layer"];
		}
	}
	
	function clsComm_ClubAdminLetterView(){
		this.clubAdminLetterList = null;
		this._init();
	}
	
	clsComm_ClubAdminLetterView.prototype = {
		_init: function(){
			
		}
		, getClubAdminLetterView: function(){
			var thisClass = this;
			var objJson = new MJson();
			var cm = new ConnectionManager();

			objJson.putClient("userid", _util.getLogin("아이디"));
			objJson.putPub(MJson.PUB.SID, "CL001");
			objJson.putPub(MJson.PUB.SERVICENAME, "getSentMessageDetail");
			
			objJson.putParameter("clubSeq", _gf.CLUB_DATA["동호회키"]);
			objJson.putParameter("messageOutSeq", _gf.CLUB_DATA["쪽지키"]);
			
			cm.requestGet(objJson.getJsonString(), function($jsonData){
				
				var res = $jsonData["msp"]["contents"]["items"];
				thisClass.totalCount = $jsonData["msp"]["contents"]["@totalcount"];
				thisClass.clubAdminLetterList = [];
				if(res){	
							
					var obj = res;
					thisClass.clubAdminLetterList = {
						"클럽키": _util.nvl(obj.clubSeq)
						, "쪽지키": _util.nvl(obj.messageOutSeq)
						, "발송일자": _util.nvl(obj.sendDate)
						, "발송시간": _util.nvl(obj.sendTime)
						, "발송대상": _util.nvl(obj.targetMemberRole)
						, "메세지": _util.nvl(obj.messageOut.messageBody)
					}
					
				}
				$(thisClass).trigger("evtFinishClubAdminLetterView");
			}, function($err) {
				alert($err);
			});
		}
		, updateMessage: function(arg){
			
			var thisClass = this;
			var objJson = new MJson();
			var cm = new ConnectionManager();

			objJson.putClient("userid", _util.getLogin("아이디"));
			objJson.putPub(MJson.PUB.SID, "CL001");
			objJson.putPub(MJson.PUB.SERVICENAME, "sendClubMessage");
			
			objJson.putParameter("clubSeq", this.getClubAdminLetterData()["클럽키"]);
			objJson.putParameter("targetMemberRole", this.getClubAdminLetterData()["발송대상"]);
			objJson.putParameter("messageBody", this.getClubAdminLetterData()["메세지"]);
						
			cm.requestGet(objJson.getJsonString(), function(ret){
				var resData = {
					"응답코드": (ret["msp"]["contents"]["serviceResult"]=="00000"?true:false)
					, "메세지": _util.getResultMsg(ret)
				}
				
				$(thisClass).trigger("evtFinishUpdateSendMsg", resData);
			}, function($err) {
				alert($err);
			});
		}
		, setWriteRequest: function(key, val){
			this.writeRequest[key] = val;
		}
		, getClubAdminLetterData: function(){
			return this.clubAdminLetterList;
		}
	}
	
	function ClubAdminLetterView(){
		this.club_seq = null;
		
		this.club_info = null;
		this.objClubAdminLetterView_Info = null;
		this.objComm = null;
	}
	
	ClubAdminLetterView.prototype = {
		onPageShow : function() {
			$("a").attr("href", "").attr("data-rel", "");
	    	
			this._init();
		}
		, _beforeStart: function(){
	    	var 	thisClass = this;
	    	
	    	this._permitStart = {
				"동호회정보": false	
			}
			
	  		// 서버 메시지맵
			$.ajax({
				url: "../js/src/club/club_inc.js"
				, type: "get"
				, dataType: "script"
				, async: false
				, success: function(ret, sta){
					//alert("success!!");					
				}
				, error:function(e){
					//alert("error=" + e);
				}	
			});
			
			_cb.getClubInfoData({
				"콜백": function(ret, l){
					thisClass._permitStart["동호회정보"] = true;	
				}
			});
			
			_util.executeThread(function(){
				for(key in thisClass._permitStart){		
					if(!thisClass._permitStart[key]) return false;
				}
				return (true);
			}, function(){			
				thisClass._start();
			});
	   }
		, _init: function(){
			this.objComm = new clsComm_ClubAdminLetterView();
			this.objClubAdminLetterView_Info = new clsClubAdminLetterView_Info();
			
			this._beforeStart();
			
			this.getParam();
	    	
			this._bind();	
		}
		, _start: function(){
			this.club_info = _cb.getClubInfo();			
			
			//쪽지상세조회
			this.spinStart();
			this.objComm.getClubAdminLetterView();
		}
		, _bind: function(){
			var thisClass = this;
			
			//조회완료 이벤트
			$(this.objComm).bind("evtFinishClubAdminLetterView", function(event){
				var thisData = thisClass.objComm.getClubAdminLetterData();
				thisClass.objClubAdminLetterView_Info.setList(thisData);
				thisClass.spinEnd();
			});
			
			//쪽지재발송완료 이벤트
			$(this.objComm).bind("evtFinishUpdateSendMsg", function(event, resData){
				alert(resData["메세지"]);
				$.mobile.changePage("club_letter.html", "slide", true);
			});
			
			//쪽지재발송 버튼 이벤트
			this.objClubAdminLetterView_Info.$getLayer().find("section div.btn_area02 button").click(function(event){
				thisClass.objComm.updateMessage();
			});
			
			//엑스버튼
		 	$("section#club_admin_letter_view header div.top_title_G div.top_right a.btn11").click(function(event){
		 		event.preventDefault();
		 		_gf.CLUB_DATA = {
					"동호회키": thisClass.club_seq	
				}
		 		$.mobile.changePage("club_letter.html","slide",true);	
		 	});
		 	
			//메뉴
		 	$("section#club_admin_letter_view nav ul li a:eq(0)").click(function(event){
		 		event.preventDefault();
		 		thisClass.goNavi();
		 	});
		 	
		 	//알림
		 	$("section#club_admin_letter_view nav ul li:eq(1)").click(function(event){
		 		event.preventDefault();
		 		$.mobile.changePage("../inc/info_booking.html","slide",true);	
		 	});
		}
		, getParam: function(){
			this.club_seq = _gf.CLUB_DATA["동호회키"];
		}
		, _role: function(){
			if(!this.club_info.isMember()){
    			alert(this.club_info.getError());
    			_gf.CLUB_DATA = {
    				"동호회키": this.club_seq	
    			}
    			$.mobile.changePage("self_club.html","slide",true);
    			return;
    		}else if(!this.club_info.isAdmin()){
    			alert(this.club_info.getError());
    			_gf.CLUB_DATA = {
    				"동호회키": this.club_seq	
    			}
    			$.mobile.changePage("self_club.html","slide",true);
    			return;	
    		}
		}
		, goNavi: function(){			
			$.mobile.changePage("../inc/navi.html","slide",true);
		}
	  , spinStart: function(){		
			$.mobile.showPageLoadingMsg();			
		}
		, spinEnd: function(){			
			$.mobile.hidePageLoadingMsg();				
		}
	}